home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_7653_000038.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  3.1 KB

  1. Path: dd.chalmers.se!news.chalmers.se!sunic!trane.uninett.no!eunet.no!EU.net!news.eunet.fi!news.csc.fi!news.funet.fi!nntp.hut.fi!nntp.hut.fi!s37732v
  2. From: s37732v@snakemail.hut.fi (Markus Juhani Aalto)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Boopsi, layers and clipping???
  5. Date: 20 Mar 94 08:33:25 GMT
  6. Organization: Helsinki University of Technology, Finland
  7. Lines: 70
  8. Distribution: inet
  9. Message-ID: <S37732V.94Mar20103326@alpha.hut.fi>
  10. References: <1994Mar19.115854.29062@ida.liu.se>
  11. NNTP-Posting-Host: alpha.hut.fi
  12. In-reply-to: d92patla@odalix.ida.liu.se's message of Sat, 19 Mar 1994 11:58:54 GMT
  13.  
  14. In article <1994Mar19.115854.29062@ida.liu.se> d92patla@odalix.ida.liu.se (Patrik Lantto) writes:
  15.  
  16. > Hello!
  17.  
  18. > Here's a delicate problem for someone to solve!
  19.  
  20. > What's the proper way to do clipping when rendering a boopsi-gadget?
  21.  
  22. > I've tried the following:
  23.  
  24. > ...
  25.  
  26. >     struct GadgetInfo *ginfo = msg->gpr_GInfo;;
  27. >     struct Region *old;
  28.  
  29. >     LockLayerInfo(ginfo->gi_Layer->LayerInfo);
  30. >     LockLayer(NULL, ginfo->gi_Layer);
  31.  
  32. >     old = InstallClipRegion(ginfo->gi_Layer, myclipregion);
  33.  
  34. >     ... Rendering ...
  35.  
  36. >     InstallClipRegion(ginfo->gi_Layer, old);
  37. >     UnlockLayer(ginfo->gi_Layer);
  38. >     UnlockLayerInfo(ginfo->gi_Layer->LayerInfo);
  39.  
  40. > ...
  41.  
  42.  
  43. > Rendering will be called whenever I change a prop-gadget, and
  44. > it works just fine, but the problem comes when my window needs
  45. > refreshing. The rendering routine will be called, it will render
  46. > inside my clipregion, but as the routine returns, the clipregion
  47. > is cleared, ie. nothing can be updated inside the window until it
  48. > is moved or resized. I guess the problem is that I'm inside a pair
  49. > of BeginUpdate() and EndUpdate(), but what to do about it?
  50.  
  51. You have propably guessed correctly as it can be a problem. You can get
  52. around it however. First you check if it's window you are drawing
  53. to (get window ptr from GadgetInfo). Check if the WINDOWREFRESHING
  54. flag is up in Flags field and if it is then call EndUpdate(layer,FALSE)
  55. and after you have made rendering call BeginUpdate(layer).
  56.  
  57. Note that you must call EndUpdate before you install new CLip region.
  58.  
  59. > Any help, suggestions or whatever will be appreciated.
  60.  
  61. I hope this helps. Oh and you can propably use BeginRefresh() and 
  62. EndRefresh() too.
  63.  
  64.  
  65. > - Patrik
  66.  
  67. > Patrik Lantto                            Email: d92patla@und.ida.liu.se
  68. > Plojaregatan 26                          Phone:           +46 13 212225
  69. > S-583 30  LINKOPING    Best comic: "Ha! Wild Zontars couldn't drag that
  70. > Sweden                           information out of me! Do your worst!"
  71.  
  72.  
  73. --
  74.  
  75.  
  76. **************************************************************************
  77. *         Markus Aalto              | Helsinki University of Technology  *
  78. *                                   |                                    *
  79. *  EMail: s37732v@vipunen.hut.fi    | Faculty of Electric Engineering    *
  80. *  Phone/Fax: 358-0-8746991         |                                    *
  81. *                                   | Undergraduate in Computer Science  *
  82. **************************************************************************
  83.         
  84.